import { createApp } from "vue";
import App from "./App.vue";
import directives from "./directives";
import router from "./router";
import store from "./store";
import i18n from "./locale";
import "element-plus/dist/index.css";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import * as oneSeveIcons from "./assets/icons";
import "./styles/index.scss";
// import "./mock";

const app = createApp(App);
app.use(directives);
app.use(router);
app.use(store);
app.use(i18n(store));

//统一注册el-icon图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

//统一注册图标
for (const [key, component] of Object.entries(oneSeveIcons)) {
  app.component(`OneSeveIcon${key}`, component);
}

app.mount("#app");
